program Project1;

{$APPTYPE CONSOLE}

uses
  SysUtils;

var
  n, a, i, sum: integer;

begin
  read (n);
  sum:= 0;
  for i := 0 to n*n - 1 do
  begin
    read (a);
    if a=1 then
      inc (sum);
  end;
  write (sum shr 1);
end.
